package com.scjp_Java6.ExceptionHandling;

/*
 * Create your own exception class using the extends keyword. 
 * Write a constructor for this class that takes a String argument and stores it inside the object with a String reference. 
 * Write a method that prints out the stored String. Create a try-catch clause to exercise your new exception.
 */
public class TIJ_Ex_2 {
	void throwMyException() throws MyException {
		throw new MyException("masd");
	}

	public static void main(String[] args) {
		TIJ_Ex_2 a = new TIJ_Ex_2();
		try {
			a.throwMyException();
		} catch (MyException e) {
			e.showMessage();
		}

		// new TIJ_Ex_2().throwMyException();
	}
}
